package com.itheima.service.impl;

import com.itheima.mapper.UserMapper;
import com.itheima.pojo.User1;
import com.itheima.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;


    @Override
    public List<User1> selectAll() {
        return userMapper.selectAll();
    }

    @Override
    public User1 selectById(Integer id) {
        return userMapper.selectById(id);
    }

    //完善service的功能：增删改,严格按照规范定义方法名称
    //增insertXXX 删deleteXXX 改updateXXX 查selectXXX
    @Override
    public void deleteById(Integer id) {
        userMapper.deleteById(id);
    }
}
